<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>KPI</Title>
      <Author>LSANTANA</Author>
      <Description>Define uma interface nos moldes do framework Dao do siga2.</Description>
      <Shortcut>kpi</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Object>
          <ID>KPI</ID>
          <Type>Object</Type>
          <ToolTip>Digite o nome da KPI?</ToolTip>
          <Default>[KPI]</Default>
        </Object>
      </Declarations>
      <Code Language="VB" Kind="file"><![CDATA[
    <TestMethod()> Public Sub $KPI$_SQL()

        Dim _session As ISession
        Dim _sqlNativo As String = " Select ROW_NUMBER() Over(ORDER BY COUNT(Campo)) as i , COUNT(Campo) as Qtd, Campo from $KPI$  Group By Campo "
        Dim _retorno As System.Collections.ArrayList
        Dim _sqlQuery As ISQLQuery

        _session = Me.SessionFactory.OpenSession()

        _sqlQuery = _session.CreateSQLQuery(_sqlNativo).AddEntity(GetType($KPI$))

        _retorno = _sqlQuery.List()

        For Each _item In _retorno
            Destrinchador.DestrinchaClasse(_item)
        Next

        Assert.IsTrue(True)

    End Sub
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>